package com.lenovo.vod.player.callback;

import com.lenovo.vod.player.Constant;
import com.lenovo.vod.player.Engine;

import android.media.MediaPlayer;
import android.media.MediaPlayer.OnPreparedListener;
import android.util.Log;

public class PreparedListener implements OnPreparedListener {
	private Engine mEngine;

	public PreparedListener(Engine engine) {
		mEngine = engine;
	}

	@Override
	public void onPrepared(MediaPlayer mediaplayer) {
		Log.d(Constant.TAG, "onPrepared called");

		mEngine.setVideoReadyToBePlayed(true);
		if (mEngine.getVideoSizeKnown()) {
			mEngine.start();
			mEngine.init();
		}
	}
}
